<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
<div id="root">
    <h2>欢迎来到{{name}}学习！</h2>
<!--    <button v-on:click="showInfo1">提示</button>-->
    <button @click="showInfo1">提示</button>
    <button @click="showInfo2($event, 66)">提示</button>
</div>
<script type="text/javascript">
    Vue.config.productionTip = false;
    const vm = new Vue({
        el: '#root',
        data(){

            return {
                name:"abc"
            }
        },
        methods:{
            showInfo1(e){
                console.log("提示信息！");
            },
            showInfo2(e, num){
                console.log(`提示信息：${num}`);
            }
        }
    });
</script>
</body>
</html>